unit F_HistorialUsuario;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ABM, DB, Grids, DBGrids, JvExDBGrids, JvDBGrid, JvDBUltimGrid,
  StdCtrls, JvExControls, JvSpeedButton, ExtCtrls, ZAbstractRODataset,
  ZDataset, JvComponentBase, JvFormPlacement;

type
  TF_HistorialDeUsuario = class(TF_ABM)
    ZROQ_PedidosUsuario: TZReadOnlyQuery;
    JvDBUltimGrid1: TJvDBUltimGrid;
    procedure B_AgregarMateriasClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    idCli: integer;
    constructor Create (var owner: TComponent; idcliente:integer);
  end;

implementation

uses DM_Persistencia, Detalle_Orden_Usuario;

{$R *.dfm}

constructor TF_HistorialDeUsuario.Create (var owner: TComponent; idcliente:integer);
begin
  inherited Create(owner, 2);
  idCli:= idCliente;
  with ZROQ_PedidosUsuario do
    begin
      Close;
      Params.ParamByName('ID_Usuario').AsInteger:= idcliente;
      Open;
    end;
end;
procedure TF_HistorialDeUsuario.B_AgregarMateriasClick(Sender: TObject);
var
  idPedido: String;
begin
  with TF_DetalleOrden_Usuario.Create(Self, idCli, ZROQ_PedidosUsuario.FieldByName('ID').AsInteger) do
    begin
      idPedido:= ZROQ_PedidosUsuario.FieldByName('ID').AsString;
      LabelNroOrden.Caption:= idPedido;
      Caption:= Caption + idPedido;
      ShowModal;
      Free;
   end;
end;

end.
